﻿using System;
using System.Collections.Generic;
namespace ConsoleApp2
{
  //   4.	分拣奇偶数 int[]{1,2,3,4,5,6,7,8,9}
    class Program
    {
        static void Main(string[] args)
        {
            List<int> ou = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
            ou.RemoveAll(x => x % 2 == 0);
            Console.WriteLine("分拣后的奇数为"+string.Join(" ",ou));
            ou.Clear();
            Console.WriteLine(string.Join(" ",ou));
            ou.AddRange(new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 });
            Console.WriteLine(string.Join(" ", ou));
            ou.RemoveAll(h => h % 2 != 0);
            Console.WriteLine("分拣后的偶数为"+string.Join(" ",ou));
        }
    }
}
